package com.choupin.choupin.admin.entity;

import com.choupin.choupin.entity.BaseEntity;

import java.time.LocalDateTime;
import java.util.Date;
import java.util.Objects;

public class Administration extends BaseEntity {
   private Integer id; //管理员表id
   private String phone; //手机号，可用登入账号
   private String avatar;// 头像
   private String authentication;// 认证码
   private String  password;// 密码
   private String salt;// 盐值
   private String nickname;// 昵称
   private Integer  gender;// 性别，0男或1女
   private Date birthday;// 出生日期
   private Integer age;//年龄
   private Integer isDelete;// 是否删除，0代表未删除，1代表已删除

    public Administration() {
    }

    public Administration(Integer id, String phone, String avatar, String authentication, String password, String salt, String nickname, Integer gender, Date birthday, Integer age, Integer isDelete) {
        this.id = id;
        this.phone = phone;
        this.avatar = avatar;
        this.authentication = authentication;
        this.password = password;
        this.salt = salt;
        this.nickname = nickname;
        this.gender = gender;
        this.birthday = birthday;
        this.age = age;
        this.isDelete = isDelete;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getAvatar() {
        return avatar;
    }

    public void setAvatar(String avatar) {
        this.avatar = avatar;
    }

    public String getAuthentication() {
        return authentication;
    }

    public void setAuthentication(String authentication) {
        this.authentication = authentication;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getSalt() {
        return salt;
    }

    public void setSalt(String salt) {
        this.salt = salt;
    }

    public String getNickname() {
        return nickname;
    }

    public void setNickname(String nickname) {
        this.nickname = nickname;
    }

    public Integer getGender() {
        return gender;
    }

    public void setGender(Integer gender) {
        this.gender = gender;
    }

    public Date getBirthday() {
        return birthday;
    }

    public void setBirthday(Date birthday) {
        this.birthday = birthday;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public Integer getIsDelete() {
        return isDelete;
    }

    public void setIsDelete(Integer isDelete) {
        this.isDelete = isDelete;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Administration that = (Administration) o;
        return Objects.equals(id, that.id) &&
                Objects.equals(phone, that.phone) &&
                Objects.equals(avatar, that.avatar) &&
                Objects.equals(authentication, that.authentication) &&
                Objects.equals(password, that.password) &&
                Objects.equals(salt, that.salt) &&
                Objects.equals(nickname, that.nickname) &&
                Objects.equals(gender, that.gender) &&
                Objects.equals(birthday, that.birthday) &&
                Objects.equals(age, that.age) &&
                Objects.equals(isDelete, that.isDelete);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, phone, avatar, authentication, password, salt, nickname, gender, birthday, age, isDelete);
    }

    @Override
    public String toString() {
        return "Administration{" +
                "id=" + id +
                ", phone='" + phone + '\'' +
                ", avatar='" + avatar + '\'' +
                ", authentication='" + authentication + '\'' +
                ", password='" + password + '\'' +
                ", salt='" + salt + '\'' +
                ", nickname='" + nickname + '\'' +
                ", gender=" + gender +
                ", birthday=" + birthday +
                ", age=" + age +
                ", isDelete=" + isDelete +
                '}';
    }
}
